
from marshmallow import fields, validate
from applications.extensions import ma

class PositionInSchema(ma.Schema):
    deptId = fields.Str(required=True)
    positionName = fields.Str(required=True)
    remark = fields.Str()
    status = fields.Str(validate=validate.OneOf(["0", "1"]))

class PositionOutSchema(ma.Schema):
    positionId = fields.Integer(attribute="id")
    positionName = fields.Str(attribute="position_name")
    status = fields.Str(validate=validate.OneOf(["0", "1"]))
    remark = fields.Str()
    create_at = fields.DateTime()
    update_at = fields.DateTime()